include '..\libs\msgutils.inc'
include '..\libs\strlib.inc'
include '..\libs\giflib.inc'
include '..\libs\gui.inc'
;include '..\libs\winalign.inc'
include '..\libs\tform.inc'
;include '..\libs\forms.inc'
include '..\libs\application.inc'
include '..\libs\templates.inc'

include '..\libs\msgutils.asm'
include '..\libs\strlib.asm'
include '..\libs\giflib.asm'
include '..\libs\gui.asm'
;include '..\libs\winalign.asm'
include '..\libs\tform.asm'
;include '..\libs\forms.asm'
include '..\libs\application.asm'
include '..\libs\templates.asm'


proc InitProgram, .frmMainForm, .AppTitle
begin
; Main init sequence
        invoke  GetModuleHandle,0
        mov     [hInstance],eax
        invoke  GetProcessHeap
        mov     [hHeap], eax

        call    InitStrings

; Registering classes
        call    RegisterApplicationClass
        call    RegisterFormClass

; Init common controls library
        invoke  InitCommonControls

; Startup windows creation
        stdcall InitApplication, 1,  [.AppTitle]
        invoke  CreateAcceleratorTable,MainAccels, [MainAccels.Count]
        invoke  SendMessage, [hApplication], AM_SETPARAM, TApplication.hAccelerators, eax

        stdcall CreateForm, [.frmMainForm], [hApplication]

        invoke  SendMessage, [hApplication], AM_SETPARAM, TApplication.hMainForm, ebx
        invoke  SendMessage, [hApplication], AM_SETPARAM, TApplication.OnIdle, OnIdleApplication

        return
endp